export function fetchImage(name: string) {
  return new Promise<HTMLImageElement>((resolve, reject) => {
    const image = new Image();
    image.onload = () => {
      resolve(image);
    };
    image.onerror = (err) => reject(err);
    image.crossOrigin = 'anonymous';
    image.src = 'files/' + name;
  });
}
